<!doctype html>



  


<html class="theme-next mist use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"/>




  <link href="//fonts.useso.com/css?family=Lato:300,400,700,400italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">



<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=0.5.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Vim," />





  <link rel="alternate" href="/atom.xml" title="Lippi-浮生志" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=0.5.0" />






<meta name="description" content="除了一些常用的插件比如ctags，taglist，bufexplorer,winmamager之外，这里介绍一些很强大的插件。
1.Vundle Github主页，一个强大的插件管理器">
<meta property="og:type" content="article">
<meta property="og:title" content="一些强大的Vim插件">
<meta property="og:url" content="http://www.ezlippi.com/blog/2015/03/vim-plugins.html">
<meta property="og:site_name" content="Lippi-浮生志">
<meta property="og:description" content="除了一些常用的插件比如ctags，taglist，bufexplorer,winmamager之外，这里介绍一些很强大的插件。
1.Vundle Github主页，一个强大的插件管理器">
<meta property="og:image" content="https://camo.githubusercontent.com/2135f9b37963594325b304a7a57163b5b6ab8b11/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3231343438382f3632333135312f32383461643836652d636635622d313165322d383238652d3235376433316266303537322e706e67">
<meta property="og:image" content="https://camo.githubusercontent.com/4a4d1893ce150863dd815fa6967e5f526ac84727/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3231343438382f3632333439362f39346564313961322d636636382d313165322d386433332d3361616438613339643763312e676966">
<meta property="og:image" content="http://foocoder.qiniudn.com/blog/syntasticsyntastic.png?token=hYfsyKwhHPe-Ga-1Hypx5F8CwimEywvTI8XdNpEm:z6zQYbdezgOYcKfzok7LEkuRDkg=:eyJTIjoiZm9vY29kZXIucWluaXVkbi5jb20vYmxvZy9zeW50YXN0aWNzeW50YXN0aWMucG5nIiwiRSI6MTQwMDA2ODU2N30=">
<meta property="og:updated_time" content="2016-02-29T12:52:50.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="一些强大的Vim插件">
<meta name="twitter:description" content="除了一些常用的插件比如ctags，taglist，bufexplorer,winmamager之外，这里介绍一些很强大的插件。
1.Vundle Github主页，一个强大的插件管理器">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: 0,
      author: '博主'
    }
  };
</script>

  <title> 一些强大的Vim插件 | Lippi-浮生志 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?340874ba9357cbe81570aa4ac1185941";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>






  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner">
<script>
(function(){
    var bp = document.createElement('script');
    bp.src = '//push.zhanzhang.baidu.com/push.js';
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
            
<div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">Lippi-浮生志</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle"></p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu menu-left">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-home fa-fw"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-th fa-fw"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-archive fa-fw"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-tags fa-fw"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-user fa-fw"></i> <br />
            
            关于
          </a>
        </li>
      

      
      
      
    </ul>
  

  
    <div class="site-search">
      
  <form class="site-search-form">
  <input type="text" id="st-search-input" class="st-search-input st-default-search-input" />
</form>

<script type="text/javascript">
  (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
    (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
    e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
  })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

  _st('install', 'fLM9qfxyerC6njvM7usy','2.0.0');
</script>



    </div>
  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                一些强大的Vim插件
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">发表于</span>
            <time itemprop="dateCreated" datetime="2015-03-20T09:20:26+08:00" content="2015-03-20">
              2015-03-20
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/other/" itemprop="url" rel="index">
                    <span itemprop="name">other</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/blog/2015/03/vim-plugins.html#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="/blog/2015/03/vim-plugins.html" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          
          
	
	<span id="busuanzi_container_page_pv" class="post-meta-item-text">
		&nbsp; | &nbsp;  
	    <span id="busuanzi_value_page_pv"><i class="fa fa-spinner fa-spin"></i></span> Hits
	</span>
        </div>
      </header>
    
	


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>除了一些常用的插件比如ctags，taglist，bufexplorer,winmamager之外，这里介绍一些很强大的插件。</p>
<p>1.<em>Vundle</em> <a href="https://github.com/gmarik/Vundle.vim" target="_blank" rel="external">Github主页</a>，一个强大的插件管理器<br><a id="more"></a></p>
<h3 id="Vundle可以："><a href="#Vundle可以：" class="headerlink" title="Vundle可以："></a>Vundle可以：</h3><p>1.在Vimrc文件里跟踪和配置你的插件</p>
<p>2.只需敲一条命令就可以安装、更新、搜索、清除插件</p>
<h3 id="安装Vundle"><a href="#安装Vundle" class="headerlink" title="安装Vundle"></a>安装Vundle</h3><pre><code>$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
</code></pre><p>配置Vundle插件：</p>
<pre><code>set nocompatible              &quot; be iMproved, required
filetype off                  &quot; required

&quot; set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
&quot; alternatively, pass a path where Vundle should install plugins
&quot;call vundle#begin(&apos;~/some/path/here&apos;)
&quot;在下面添加你需要安装的插件
&quot; let Vundle manage Vundle, required
Plugin &apos;gmarik/Vundle.vim&apos;

&quot; The following are examples of different formats supported.
&quot; Keep Plugin commands between vundle#begin/end.
&quot;在Github仓库的插件
Plugin &apos;tpope/vim-fugitive&apos;
&quot; http://vim-scripts.org/vim/scripts.html网站上的插件直接写插件名称
Plugin &apos;L9&apos;
&quot; Git plugin not hosted on GitHub
Plugin &apos;git://git.wincent.com/command-t.git&apos;
&quot; 本机目录下的插件
Plugin &apos;file:///home/gmarik/path/to/plugin&apos;
&quot; The sparkup vim script is in a subdirectory of this repo called vim.
&quot; Pass the path to set the runtimepath properly.
Plugin &apos;rstacruz/sparkup&apos;, {&apos;rtp&apos;: &apos;vim/&apos;}
&quot; Avoid a name conflict with L9
Plugin &apos;user/L9&apos;, {&apos;name&apos;: &apos;newL9&apos;}

&quot; 所有的插件需要在这一行之前添加
call vundle#end()            &quot; required
filetype plugin indent on    &quot; required
&quot; To ignore plugin indent changes, instead use:
&quot;filetype plugin on
</code></pre><h3 id="如何使用Vundle"><a href="#如何使用Vundle" class="headerlink" title="如何使用Vundle"></a>如何使用Vundle</h3><pre><code>&quot; Brief help
&quot; :PluginList       - lists configured plugins
&quot; :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
&quot; :PluginSearch foo - searches for foo; append `!` to refresh local cache
&quot; :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal

&quot; 使用:h vundle 显示帮助文档
</code></pre><hr>
<p>2.<em>neocomplete</em> <a href="https://github.com/Shougo/neocomplete.vim" target="_blank" rel="external">github主页</a>，一个比VIm自带补全更强大的自动补全插件，支持更多的特性。</p>
<h3 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h3><p>确保你的系统安装了下列之一：</p>
<ul>
<li>vim-nox</li>
<li>vim-gtk</li>
<li>vim-gnome</li>
<li>vim-athena</li>
</ul>
<p>然后再Vundle中添加一句：Plugin ‘Shougo/neocomplete.vim’，重新打开Vim就自动安装了</p>
<h3 id="ScreenShots"><a href="#ScreenShots" class="headerlink" title="ScreenShots"></a>ScreenShots</h3><p><img src="https://camo.githubusercontent.com/2135f9b37963594325b304a7a57163b5b6ab8b11/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3231343438382f3632333135312f32383461643836652d636635622d313165322d383238652d3235376433316266303537322e706e67" alt=""></p>
<p><img src="https://camo.githubusercontent.com/4a4d1893ce150863dd815fa6967e5f526ac84727/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3231343438382f3632333439362f39346564313961322d636636382d313165322d386433332d3361616438613339643763312e676966" alt=""></p>
<h3 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h3><pre><code>&quot;Note: This option must set it in .vimrc(_vimrc).  NOT IN .gvimrc(_gvimrc)!
&quot; Disable AutoComplPop.
let g:acp_enableAtStartup = 0
&quot; Use neocomplete.
let g:neocomplete#enable_at_startup = 1
&quot; Use smartcase.
let g:neocomplete#enable_smart_case = 1
&quot; Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#lock_buffer_name_pattern = &apos;\*ku\*&apos;

&quot; Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
    \ &apos;default&apos; : &apos;&apos;,
    \ &apos;vimshell&apos; : $HOME.&apos;/.vimshell_hist&apos;,
    \ &apos;scheme&apos; : $HOME.&apos;/.gosh_completions&apos;
        \ }

&quot; Define keyword.
if !exists(&apos;g:neocomplete#keyword_patterns&apos;)
    let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns[&apos;default&apos;] = &apos;\h\w*&apos;

&quot; Plugin key-mappings.
inoremap &lt;expr&gt;&lt;C-g&gt;     neocomplete#undo_completion()
inoremap &lt;expr&gt;&lt;C-l&gt;     neocomplete#complete_common_string()

&quot; Recommended key-mappings.
&quot; &lt;CR&gt;: close popup and save indent.
inoremap &lt;silent&gt; &lt;CR&gt; &lt;C-r&gt;=&lt;SID&gt;my_cr_function()&lt;CR&gt;
function! s:my_cr_function()
  return neocomplete#close_popup() . &quot;\&lt;CR&gt;&quot;
  &quot; For no inserting &lt;CR&gt; key.
  &quot;return pumvisible() ? neocomplete#close_popup() : &quot;\&lt;CR&gt;&quot;
endfunction
&quot; &lt;TAB&gt;: completion.
inoremap &lt;expr&gt;&lt;TAB&gt;  pumvisible() ? &quot;\&lt;C-n&gt;&quot; : &quot;\&lt;TAB&gt;&quot;
&quot; &lt;C-h&gt;, &lt;BS&gt;: close popup and delete backword char.
inoremap &lt;expr&gt;&lt;C-h&gt; neocomplete#smart_close_popup().&quot;\&lt;C-h&gt;&quot;
inoremap &lt;expr&gt;&lt;BS&gt; neocomplete#smart_close_popup().&quot;\&lt;C-h&gt;&quot;
inoremap &lt;expr&gt;&lt;C-y&gt;  neocomplete#close_popup()
inoremap &lt;expr&gt;&lt;C-e&gt;  neocomplete#cancel_popup()
&quot; Close popup by &lt;Space&gt;.
&quot;inoremap &lt;expr&gt;&lt;Space&gt; pumvisible() ? neocomplete#close_popup() : &quot;\&lt;Space&gt;&quot;

&quot; For cursor moving in insert mode(Not recommended)
&quot;inoremap &lt;expr&gt;&lt;Left&gt;  neocomplete#close_popup() . &quot;\&lt;Left&gt;&quot;
&quot;inoremap &lt;expr&gt;&lt;Right&gt; neocomplete#close_popup() . &quot;\&lt;Right&gt;&quot;
&quot;inoremap &lt;expr&gt;&lt;Up&gt;    neocomplete#close_popup() . &quot;\&lt;Up&gt;&quot;
&quot;inoremap &lt;expr&gt;&lt;Down&gt;  neocomplete#close_popup() . &quot;\&lt;Down&gt;&quot;
&quot; Or set this.
&quot;let g:neocomplete#enable_cursor_hold_i = 1
&quot; Or set this.
&quot;let g:neocomplete#enable_insert_char_pre = 1

&quot; AutoComplPop like behavior.
&quot;let g:neocomplete#enable_auto_select = 1

&quot; Shell like behavior(not recommended).
&quot;set completeopt+=longest
&quot;let g:neocomplete#enable_auto_select = 1
&quot;let g:neocomplete#disable_auto_complete = 1
&quot;inoremap &lt;expr&gt;&lt;TAB&gt;  pumvisible() ? &quot;\&lt;Down&gt;&quot; : &quot;\&lt;C-x&gt;\&lt;C-u&gt;&quot;

&quot; Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags

&quot; Enable heavy omni completion.
if !exists(&apos;g:neocomplete#sources#omni#input_patterns&apos;)
  let g:neocomplete#sources#omni#input_patterns = {}
endif
&quot;let g:neocomplete#sources#omni#input_patterns.php = &apos;[^. \t]-&gt;\h\w*\|\h\w*::&apos;
&quot;let g:neocomplete#sources#omni#input_patterns.c = &apos;[^.[:digit:] *\t]\%(\.\|-&gt;\)&apos;
&quot;let g:neocomplete#sources#omni#input_patterns.cpp = &apos;[^.[:digit:] *\t]\%(\.\|-&gt;\)\|\h\w*::&apos;

&quot; For perlomni.vim setting.
&quot; https://github.com/c9s/perlomni.vim
let g:neocomplete#sources#omni#input_patterns.perl = &apos;\h\w*-&gt;\h\w*\|\h\w*::&apos;
</code></pre><p>3.<em>CtrlP插件</em> <a href="https://github.com/kien/ctrlp.vim" target="_blank" rel="external">github主页</a></p>
<p>快速查找文件、缓冲区、tag的Vim插件，可以同时打开多个文件，创建文件和目录</p>
<p>基本操作：</p>
<pre><code>在Vim中按下Ctrl+p打开Ctrlp插件
&lt;c-d&gt;在路径搜索和文件名搜索之间切换
 &lt;c-r&gt;在字符串搜索和正则表达式搜索中切换
&lt;c-f&gt;和&lt;c-b&gt;forward和backward，搜索结果在不同搜索模式中切换
&lt;c-j&gt;&lt;c-k&gt;在结果中切换
&lt;c-n&gt;&lt;c-p&gt;在搜索历史中切换
&lt;c-t&gt;在新Tab中打开选中的文件
&lt;c-v&gt;在垂直分屏中打开选中的文件
&lt;c-s&gt;在水平分屏中打开选中的文件
&lt;c-y&gt;创建新的文件和目录
&lt;c-z&gt;标记将要打开的文件
&lt;c-o&gt;打开被&lt;c-z&gt;标记的文件
</code></pre><p>4<em>surround</em> <a href="https://github.com/tpope/vim-surround" target="_blank" rel="external">github主页</a></p>
<p>大多数编程语言的语法都用到了配对符号surrounding: (), [], {}, &lt;&gt;, ‘’, “”，标记语言xml html 等更是完全依赖与这种语法。正常输入时，所有的编辑器都能胜任，大部分会在你输入一个括号时帮你补全另一半。vim 也有这样的插件auto-pair, 但是这个不是重点，真正的难题是当你需要为已一些存在的代码加上括号，删除一对括号但保留其中的内容，或者把一对()改成[]。</p>
<p>使用surround，你将很容易添加和修改配对符号，比如：</p>
<pre><code>   Old text                  Command         New text ~
&quot;Hello *world!&quot;                 ds&quot;         Hello world!
[123+4*56]/2                    cs])        (123+456)/2
&quot;Look ma, I&apos;m *HTML!&quot;            cs&quot;&lt;q&gt;      &lt;q&gt;Look ma, I&apos;m HTML!&lt;/q&gt;
if *x&gt;3 {                        ysW(        if ( x&gt;3 ) {
my $str = *whee!;                vlllls&apos;     my $str = &apos;whee!&apos;;
&lt;div&gt;Yo!*&lt;/div&gt;                dst         Yo!
&lt;div&gt;Yo!*&lt;/div&gt;                cst&lt;p&gt;      &lt;p&gt;Yo!&lt;/p&gt;
</code></pre><p>上面*代表当前光标位置，添加替换时使用后半括号)]}，添加的括号和内容间就没有空格（如第2个示例），反之会在内容前后添加一个空格（如第4个实例）。第6个示例中的t代表一对HTML或者xml tag。其他表示范围的符号：w代表word, W代表WORD(被空格分开的连续的字符窜），p代表paragraph。</p>
<h3 id="命令列表"><a href="#命令列表" class="headerlink" title="命令列表"></a>命令列表</h3><pre><code>    Normal mode
-----------
ds  - delete a surrounding
cs  - change a surrounding
ys  - add a surrounding
yS  - add a surrounding and place the surrounded text on a new line + indent it
yss - add a surrounding to the whole line
ySs - add a surrounding to the whole line, place it on a new line + indent it
ySS - same as ySs

Visual mode
-----------
s   - in visual mode, add a surrounding
S   - in visual mode, add a surrounding but place text on new line + indent it

Insert mode
-----------
&lt;CTRL-s&gt; - in insert mode, add a surrounding
&lt;CTRL-s&gt;&lt;CTRL-s&gt; - in insert mode, add a new line + surrounding + indent
&lt;CTRL-g&gt;s - same as &lt;CTRL-s&gt;
&lt;CTRL-g&gt;S - same as &lt;CTRL-s&gt;&lt;CTRL-s&gt;
</code></pre><p>5.<em>syntastic</em>  <a href="https://github.com/scrooloose/syntastic#installation" target="_blank" rel="external">githun主页</a></p>
<p>来看一下官方给的图片：<br><img src="http://foocoder.qiniudn.com/blog/syntasticsyntastic.png?token=hYfsyKwhHPe-Ga-1Hypx5F8CwimEywvTI8XdNpEm:z6zQYbdezgOYcKfzok7LEkuRDkg=:eyJTIjoiZm9vY29kZXIucWluaXVkbi5jb20vYmxvZy9zeW50YXN0aWNzeW50YXN0aWMucG5nIiwiRSI6MTQwMDA2ODU2N30=" alt=""></p>
<ul>
<li>图片很清楚的介绍了插件功能：</li>
<li>用location list 列出所有错误。</li>
<li>命令行窗口显示当前错误。</li>
<li>错误标记，有警告和错误。</li>
<li>鼠标悬停可以出现错误提示框</li>
<li>状态栏标记。</li>
</ul>
<h3 id="配置-1"><a href="#配置-1" class="headerlink" title="配置"></a>配置</h3><p>当然也可以做一些简单的配置，比如设置为每次打开buffer就执行语法检查，而不只是在保存时：<br>    let g:syntastic_check_on_open = 1<br>如果想使用多个检查器，可以这样写：<br>    let g:syntastic_php_checkers = [‘php’, ‘phpcs’, ‘phpmd’]</p>
<h3 id="错误跳转"><a href="#错误跳转" class="headerlink" title="错误跳转"></a>错误跳转</h3><p>syntastic使用location list来显示所有的错误，location list和quificfix 类似，包含了位置信息。<br>调起这个location list<br>    :Errors 或者 :lopen<br>使用:lne[xt]和:lp[revious]就可以在错误间跳转。当然，如果用的多，可以做个mapping,更多内容可以参考帮助文档:help syntastic.</p>
<p>6.<em>fugitive</em><a href="https://github.com/tpope/vim-fugitive" target="_blank" rel="external">github主页</a></p>
<blockquote>
<p>If you don’t know GIT, learn it right now!If you use GIT and VIM, use Fugitive right now!</p>
</blockquote>
<p>fugitive.vim插件是由Tim Pope创建的VIM插件。该插件与命令行git工具相辅相成，可以无缝的插入到工作流程中。</p>
<p>在VIM的命令行中，%符号具有特殊的含义：他将扩展为当前文件的全路径。可以使用该命令来运行使用文件名作为参数的任意git命令，从而使得命令作用于当前的文件。但是fugitive也提供了一些便利的方法，其中的一些总结如下：</p>
<pre><code>  git                 fugitive          action
:Git add %            :Gwrite           Stage the current file to the index
:Git checkout %        :Gread             Revert current file to last checked in version
:Git rm %            :Gremove         Delete the current file and the corresponding Vim buffer
:Git mv %            :Gmove             Rename the current file and the corresponding Vim buffer
</code></pre>
      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Vim/" rel="tag">#Vim</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/2015/03/android-studio-prefrence.html" rel="next" title="Android Studio多渠道打包和代码混淆教程">
                <i class="fa fa-chevron-left"></i> Android Studio多渠道打包和代码混淆教程
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/2015/04/java-code-opt-one.html" rel="prev" title="优化java代码建议(1)">
                优化java代码建议(1) <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="/blog/2015/03/vim-plugins.html"
     data-title="一些强大的Vim插件"
     data-content=""
     data-url="http://www.ezlippi.com//blog/2015/03/vim-plugins.html">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          

  <p>热评文章</p>
  <div class="ds-top-threads" data-range="weekly" data-num-items="4"></div>


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="/blog/2015/03/vim-plugins.html"
           data-title="一些强大的Vim插件" data-url="http://www.ezlippi.com//blog/2015/03/vim-plugins.html">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.jpg"
               alt="EZLippi" />
          <p class="site-author-name" itemprop="name">EZLippi</p>
          <p class="site-description motion-element" itemprop="description">Easy Lippi</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">63</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>
          
          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">22</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">69</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/EZLippi" target="_blank">
                  
                    <i class="fa fa-github"></i> GitHub
                  
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/ouyanglip" target="_blank">
                  
                    <i class="fa fa-weibo"></i> weibo
                  
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/lippi-ouyang" target="_blank">
                  
                    <i class="fa fa-weibo"></i> zhihu
                  
                </a>
              </span>
            
          
        </div>

        
        

        <div class="links-of-author motion-element">
          
            <p class="site-author-name">友情链接</p>
            
              <span class="links-of-author-item">
                <a href="http://szhshp.org" target="_blank">szhshp的博客</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.zhihu.com/people/lippi-ouyang" target="_blank">友链出租</a>
              </span>
            
          
        </div>

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc-indicator-top post-toc-indicator">
            <i class="fa fa-angle-double-up"></i>
          </div>
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#Vundle可以："><span class="nav-number">1.</span> <span class="nav-text">Vundle可以：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装Vundle"><span class="nav-number">2.</span> <span class="nav-text">安装Vundle</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#如何使用Vundle"><span class="nav-number">3.</span> <span class="nav-text">如何使用Vundle</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装"><span class="nav-number">4.</span> <span class="nav-text">安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#ScreenShots"><span class="nav-number">5.</span> <span class="nav-text">ScreenShots</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置"><span class="nav-number">6.</span> <span class="nav-text">配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#命令列表"><span class="nav-number">7.</span> <span class="nav-text">命令列表</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置-1"><span class="nav-number">8.</span> <span class="nav-text">配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#错误跳转"><span class="nav-number">9.</span> <span class="nav-text">错误跳转</span></a></li></ol></div>
            
          </div>
          <div class="post-toc-indicator-bottom post-toc-indicator">
            <i class="fa fa-angle-double-down"></i>
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2014 - 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">EZLippi</span>
</div>

<div class="powered-by">
  由 <a class="theme-link" href="http://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
   托管在 -
  <a class="theme-link" href="https://github.com/EZLippi/EZLippi.github.io">
    Github
  </a>

</div>
<div class="theme-info">
<span id="busuanzi_container_site_pv">
    &nbsp; | &nbsp;本站总访问量<span id="busuanzi_value_site_pv"></span>次
</span>
</div>
<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>



      </div>
    </footer>

    <div class="back-to-top"></div>
  </div>

  


  



  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  <script type="text/javascript" src="/vendors/velocity/velocity.min.js"></script>

  <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js"></script>

  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=0.5.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=0.5.0"></script>



  
  

  
  
<script type="text/javascript" src="/js/src/scrollspy.js?v=0.5.0"></script>

<script type="text/javascript" id="sidebar.toc.highlight">
  $(document).ready(function () {
    var tocSelector = '.post-toc';
    var $tocSelector = $(tocSelector);
    var activeCurrentSelector = '.active-current';

    $tocSelector
      .on('activate.bs.scrollspy', function () {
        var $currentActiveElement = $(tocSelector + ' .active').last();

        removeCurrentActiveClass();
        $currentActiveElement.addClass('active-current');

        $tocSelector[0].scrollTop = $currentActiveElement.position().top;
      })
      .on('clear.bs.scrollspy', function () {
        removeCurrentActiveClass();
      });

    function removeCurrentActiveClass () {
      $(tocSelector + ' ' + activeCurrentSelector)
        .removeClass(activeCurrentSelector.substring(1));
    }

    function processTOC () {
      getTOCMaxHeight();
      toggleTOCOverflowIndicators();
    }

    function getTOCMaxHeight () {
      var height = $('.sidebar').height() -
                   $tocSelector.position().top -
                   $('.post-toc-indicator-bottom').height();

      $tocSelector.css('height', height);

      return height;
    }

    function toggleTOCOverflowIndicators () {
      tocOverflowIndicator(
        '.post-toc-indicator-top',
        $tocSelector.scrollTop() > 0 ? 'show' : 'hide'
      );

      tocOverflowIndicator(
        '.post-toc-indicator-bottom',
        $tocSelector.scrollTop() >= $tocSelector.find('ol').height() - $tocSelector.height() ? 'hide' : 'show'
      )
    }

    $(document).on('sidebar.motion.complete', function () {
      processTOC();
    });

    $('body').scrollspy({ target: tocSelector });
    $(window).on('resize', function () {
      if ( $('.sidebar').hasClass('sidebar-active') ) {
        processTOC();
      }
    });

    onScroll($tocSelector);

    function onScroll (element) {
      element.on('mousewheel DOMMouseScroll', function (event) {
          var oe = event.originalEvent;
          var delta = oe.wheelDelta || -oe.detail;

          this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30;
          event.preventDefault();

          toggleTOCOverflowIndicators();
      });
    }

    function tocOverflowIndicator (indicator, action) {
      var $indicator = $(indicator);
      var opacity = action === 'show' ? 1 : 0;
      $indicator.velocity ?
        $indicator.velocity('stop').velocity({
          opacity: opacity
        }, { duration: 100 }) :
        $indicator.stop().animate({
          opacity: opacity
        }, 100);
    }

  });
</script>

<script type="text/javascript" id="sidebar.nav">
  $(document).ready(function () {
    var html = $('html');
    var TAB_ANIMATE_DURATION = 200;
    var hasVelocity = $.isFunction(html.velocity);

    $('.sidebar-nav li').on('click', function () {
      var item = $(this);
      var activeTabClassName = 'sidebar-nav-active';
      var activePanelClassName = 'sidebar-panel-active';
      if (item.hasClass(activeTabClassName)) {
        return;
      }

      var currentTarget = $('.' + activePanelClassName);
      var target = $('.' + item.data('target'));

      hasVelocity ?
        currentTarget.velocity('transition.slideUpOut', TAB_ANIMATE_DURATION, function () {
          target
            .velocity('stop')
            .velocity('transition.slideDownIn', TAB_ANIMATE_DURATION)
            .addClass(activePanelClassName);
        }) :
        currentTarget.animate({ opacity: 0 }, TAB_ANIMATE_DURATION, function () {
          currentTarget.hide();
          target
            .stop()
            .css({'opacity': 0, 'display': 'block'})
            .animate({ opacity: 1 }, TAB_ANIMATE_DURATION, function () {
              currentTarget.removeClass(activePanelClassName);
              target.addClass(activePanelClassName);
            });
        });

      item.siblings().removeClass(activeTabClassName);
      item.addClass(activeTabClassName);
    });

    $('.post-toc a').on('click', function (e) {
      e.preventDefault();
      var targetSelector = NexT.utils.escapeSelector(this.getAttribute('href'));
      var offset = $(targetSelector).offset().top;
      hasVelocity ?
        html.velocity('stop').velocity('scroll', {
          offset: offset  + 'px',
          mobileHA: false
        }) :
        $('html, body').stop().animate({
          scrollTop: offset
        }, 500);
    });

    // Expand sidebar on post detail page by default, when post has a toc.
    NexT.motion.middleWares.sidebar = function () {
      var $tocContent = $('.post-toc-content');

      if (CONFIG.sidebar.display === 'post' || CONFIG.sidebar.display === 'always') {
        if ($tocContent.length > 0 && $tocContent.html().trim().length > 0) {
          NexT.utils.displaySidebar();
        }
      }
    };
  });
</script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=0.5.0"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"ezlippi"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
  





  
  

  
  


</body>
</html>
